package sctu.edu.java.year2016.team01.zhuming.day20160605.chapter10_3;

import sctu.edu.java.year2016.team01.zhuming.day20160605.chapter10_3.Emp;

import java.util.HashMap;
import java.util.Map;

/**
 * 创建Map集合，创建Emp对象，并将创建的Emp对象添加到集合中E（Emp对象的id最为Map集合的健）并将id为005的对象从集合
 * 中移除。
 * Created by Administrator on 2016/6/12.
 */
public class MapCet {
    public static void main(String[] args) {
        Map map = new HashMap();

        Emp emp0 = new Emp("001", "tom");
        Emp emp1 = new Emp("002", "bob");
        Emp emp2 = new Emp("003", "mary");

        Emp emp4 = new Emp("005", "zhuli");
        Emp emp5 = new Emp("006", "meli");

        map.put(emp0.getId_card("001"), emp0.getname("tom"));
        map.put(emp1.getId_card("002"), emp1.getname("bob"));
        map.put(emp2.getId_card("003"), emp2.getname("mary"));
        map.put(emp4.getId_card("005"), emp4.getname("zhuli"));
        map.put(emp5.getId_card("006"), emp5.getname("jay"));
        System.out.println("     " + map);

        map.remove(emp4.getId_card("005"));
        System.out.println("     " + map);
    }
}